/* 
 * Copyright (c) 2021, CENTRIN.CIYUN.LTD. All rights reserved.
 */
package com.cory.boot.domain.chart;

import java.util.Arrays;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.google.common.collect.Lists;

/**
 * 桑基图
 * @author xiongcong
 * @date 2021-11-01
 */
@Data
@EqualsAndHashCode(callSuper=true)
@SuppressWarnings({"unchecked", "rawtypes"})
public class Sankey extends Series<Sankey> {
    
    private List links;

    public Sankey() {
        super.type(SeriesType.sankey);
    }
    
    public Sankey links(Object... values) {
        if ((values == null) || (values.length == 0)) {
            return this;
        }
        
        if (links == null) {
            links = Lists.newArrayList();
        }

        links.addAll(Arrays.asList(values));
        return this;
    }
}
